package com.example.dao;

import com.example.entity.Student;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.core.query.Update;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @author ：liukai
 * @date ：Created in 2021/9/8 10:28 上午
 * @description：
 * @modified By：
 * @version: $
 */
@Component
public interface StudentDao extends MongoRepository<Student, String> {

    Student findByUsername(String username);

    @Query("{'studentId': ?0}")
    Student queryDefine(long id);

    List<Student> findAllByUsername(String username, Pageable pageable);

}
